<!DOCTYPE html>
<html>
 <head> 
  <meta charset="utf-8" /> 

  <title></title> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.min.js"></script> 
<script src="https://cdn.bootcss.com/jsbarcode/3.11.0/JsBarcode.all.min.js"></script>
 </head> 
 <body> 
  <svg id="svgcode"></svg>
  <!-- or -->
  <canvas id="canvascode"></canvas>
  <!-- or -->
  <img id="imgcode" />
  <script>
        $("#svgcode").JsBarcode('Hi!');//or JsBarcode("#svgcode", "Hi!");

        $("#canvascode").JsBarcode('Hello world!');//or JsBarcode("#canvascode", "Hello world!");

        $("#imgcode").JsBarcode("I'm huangenai!");//or JsBarcode("#imgcode", "I'm huangenai!");
  </script> 
 </body>
</html>